# Maintainer: Keith Toh <ktprograms@gmail.com>
pkgname=py3-xcffib
pkgver=1.5.0
pkgrel=1
pkgdesc="Drop-in replacement for xpyb based on cffi"
url="https://github.com/tych0/xcffib"
arch="noarch"
license="Apache-2.0"
depends="py3-cffi libxcb"
makedepends="
	libxcb-dev
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest xvfb-run xeyes"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/x/xcffib/xcffib-$pkgver.tar.gz"
builddir="$srcdir/xcffib-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	cd .testenv
	ln -sfv ../test test
	bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
aaa426b57d0d8dc45cb6a2036c862af6308fb5781667b8dba3f5ff399fe5e15912860d0bb696ac09f1efd4ffbbdaf7f555ef76039bd660f36f5c6179535b654f  xcffib-1.5.0.tar.gz
"
